#version 450 core
layout (location = 0) in vec3 position;
layout (location = 1) in vec3 normal;
layout (location = 2) in vec2 tex_coord;
layout(location = 3) in vec3 instance_position;
layout(location = 4) in vec3 instance_color;
layout(location = 5) in float instance_radius;
out vec3 vertex_position;
out vec3 vertex_normal;
out vec2 vertex_tex_coord;
out vec3 vertex_color;
layout (location = 0) uniform mat4 model;
layout (location = 1) uniform mat4 view;
layout (location = 2) uniform mat4 projection;
void main()
{
    vertex_position = vec3(model * vec4(position *instance_radius + instance_position, 1.0));
    gl_Position = projection * view * vec4(vertex_position, 1.0);
    vertex_normal = normal;
    vertex_tex_coord = tex_coord;
    vertex_color = instance_color;
}

